<template>
	<view class="content">
		<u-navbar back-icon-color="#fff" :border-bottom="false" :background="{background:'transparent'}"></u-navbar>
		<view class="content_main">
			<view class="content_main-tit" v-if="data.utype == 1">
				邀请{{data.item.fullname}}参加线下面试
			</view>
			<view class="content_main-tit" v-if="data.utype == 2">
				受邀{{data.item.companyname}}参加线下面试
			</view>
			<view class="content_main_item">
				<view class="content_main_item_cell u-border-bottom">
					<view class="text u-font-32">
						面试职位
					</view>
					<view v-if="data.utype == 1" class="u-white-50 u-text-right u-line-1">
						{{data.item.jobname}}
					</view>
					<view class="u-flex" v-if="data.utype == 2"  @click="toJobDetail">
						<view class="u-white-50 u-text-right u-line-1">
							{{data.item.jobname}}
						</view>
						<u-icon name="arrow-right" size="30" color="#8a8888"></u-icon>
					</view>
				</view>
				<view class="content_main_item_cell u-border-bottom">
					<view class="text u-font-32">
						面试地址
					</view>
					<view class="u-white-50 u-text-right">
						{{data.item.address}}
					</view>
				</view>
				<view class="content_main_item_cell u-border-bottom">
					<view class="text u-font-32">
						面试时间
					</view>
					<view class="text">
						{{`${$u.timeFormat(data.item.interview_time,'yyyy-mm-dd hh:MM')}${data.item.overtime == 1 ? '（已过期）' : ''}`}}
					</view>
				</view>
				<view class="content_main_item_cell">
					<view class="text u-font-32">
						联系人
					</view>
					<view>
						{{`${data.item.contact} · ${data.item.tel}`}}
					</view>
				</view>
			</view>
			<view class="content_main_item">
				<view class="u-font-32 u-font-weight">
					备注事项
				</view>
				<view class="u-m-t-30 text">
					{{data.item.note || '无'}}
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		onLoad
	} from "@dcloudio/uni-app"
	import {
		reactive
	} from "vue";
	const data = reactive({
		utype: uni.getStorageSync('utype'),
		item: {}
	})
	onLoad(({
		item
	}) => {
		data.item = JSON.parse(item)
		if (data.item.is_look != 1 && data.utype == 2) {
			getInterviewSetLook()
		}
	})
	// 去职位详情页面
	const toJobDetail = () => {
		uni.$u.route('pages/pagesHome/detailPages/job', {
			id: data.item.jobid
		})
	}
	// 设置面试已查看状态
	const getInterviewSetLook = async () => {
		let params = {
			id: data.item.id
		}
		let res = await uni.$u.api.getInterviewSetLook(params)
	}
</script>
<style>
	page {
		background: linear-gradient(180deg,#40D99B 0%, #FAFFF4 120%);
		height: 100%;
	}
</style>
<style lang="scss">
	.content {
		&_main {
			padding-top: 80rpx;
			width: 90vw;
			margin: 0 auto;

			&-tit {
				color: #fff;
				font-size: 40rpx;
				padding: 0 20rpx;
				margin-bottom: 82rpx;
			}

			&_item {
				background-color: #fff;
				border-radius: 12rpx;
				padding: 22rpx 26rpx;
				margin-bottom: 30rpx;
				font-size: 28rpx;
				color: #101010;

				&_cell {
					height: 96rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
				}

				.text {
					color: #8a8888;
				}
			}
		}
	}
</style>